package com.bzkj.basicinfo.mapper;

import com.bzkj.basicinfo.domain.yxl.PdaWarehouseMove;
import com.bzkj.basicinfo.domain.yxl.YxlBillsList;
import com.bzkj.basicinfo.domain.yxl.vo.ExportInBillsList;
import com.bzkj.basicinfo.domain.yxl.vo.ExportOutBillsList;
import com.bzkj.basicinfo.domain.yxl.vo.YxlBillsReportVo;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * @Author：swj
 * @Desc
 * @Date：2025/8/13 10:38
 */
public interface YxlReportMapper {
    /**
     * 查询当天前十商品数据
     *
     * @return
     */
    List<YxlBillsReportVo> queryDayTop10();

    /**
     * 查询本周前十商品数据
     *
     * @return
     */
    List<YxlBillsReportVo> queryWeekTop10();

    /**
     * 查询当月前十商品数据
     *
     * @return
     */
    List<YxlBillsReportVo> queryMonthTop10();

    /**
     * 低库存预警
     * @return
     */
    List<YxlBillsReportVo> lowInventoryWarning(@Param("day") Integer day);

    /**
     * 有效期预警
     * @param expDate
     * @return
     */
    List<YxlBillsReportVo> expWarning(@Param("startDate") String startDate,@Param("endDate") String endDate);

    /**
     * 统计当天入库单据数量
     * @return
     */
    YxlBillsReportVo countInBills();

    /**
     * 统计当天出库单据数量
     * @return
     */
    YxlBillsReportVo countOutBills();

    /**
     * 统计当天出库商品数量
     * @return
     */
    YxlBillsReportVo countOutDrugNum();

    /**
     * 统计当天入库商品数量
     * @return
     */
    YxlBillsReportVo countInDrugNum();


    List<HashMap<String, Object>> queryAreaByStoId(@Param("stoId")String stoId);

    List<HashMap<String, Object>> queryUnitByAreaId(@Param("stoId")String stoId,@Param("areId")String areId,@Param("flag")String flag);

    List<HashMap<String, Object>> querySkuByUnitCode(@Param("unitCode")String unitCode);


    /**
     * 统计商品品种总数
     * @return
     */
    YxlBillsReportVo countSpTotal();

    /**
     * 库存出入库明细
     * @return
     */
    List<HashMap<String, Object>> queryWarehouseOutInDetail(@Param("type") Integer type, @Param("stoId")String stoId,
                                                            @Param("startDate")String startDate, @Param("endDate")String endDate,
                                                            @Param("drugCD")String drugCD,@Param("drugBatchNo") String drugBatchNo,
                                                            @Param("drugName")String drugName, @Param("userName")String userName,
                                                            @Param("drugJwh")String drugJwh);

    /**
     * 入库单据
     * @param billsId
     * @param stoId
     * @param startDate
     * @param endDate
     * @param billsCd
     * @param userName
     * @return
     */
   List<YxlBillsList> queryInBillsList(@Param("billsId")String billsId,@Param("stoId") String stoId,
                                       @Param("startDate") String startDate,@Param("endDate")String endDate,
                                       @Param("billsCd")String billsCd,@Param("userName")String userName);

    /**
     * 出库单据
     * @param billsId
     * @param stoId
     * @param startDate
     * @param endDate
     * @param billsCd
     * @param userName
     * @return
     */
    List<YxlBillsList> queryOutBillsList(@Param("billsId")String billsId,@Param("stoId") String stoId,
                                         @Param("startDate") String startDate,@Param("endDate")String endDate,
                                         @Param("billsCd")String billsCd,@Param("userName")String userName);

    /**
     * 移库管理
     * @param userName
     * @param spmch
     * @param batchCode
     * @return
     */
    List<PdaWarehouseMove> queryWarehouseMoveList(@Param("userName")String userName,@Param("spmch")String spmch,
                                                  @Param("batchCode")String batchCode,@Param("startDate")String startDate,
                                                  @Param("endDate")String endDate);

    /**
     *入出库单据top
     * @return
     */
    List<HashMap<String, Object>> queryInBillTop();
    List<HashMap<String, Object>> queryOutBillTop();

    /**
     * 入出库单据近十二天数量
     * @return
     */
    List<HashMap<String, Object>> selectOutNumber();
    List<HashMap<String, Object>> selectInNumber();
    /**
     * 入出库单据近十二天前十的商品
     * @return
     */
    List<HashMap<String, Object>> selectInSkuNumber();
    List<HashMap<String, Object>> selectOutSkuNumber();

    //货位统计接口
    List<HashMap<String, Object>> countUnitNum(@Param("mode")String mode,@Param("stoId")String stoId,@Param("type")String type);


    //往来单位接口
    List<HashMap<String, Object>> selectCustomer();
    List<HashMap<String, Object>> selectCustomerQuarter();
    List<HashMap<String, Object>> selectCustomerYear();
    //往来单位同比环比
    List<HashMap<String, Object>> selectCustomerYearAndMonth(@Param("dateRange")String dateRange);
    //追溯码
    List<HashMap<String, Object>> selectBarCode(@Param("barCode")String barCode,@Param("orderId")String orderId);
    List<HashMap<String, Object>> selectBarCodeByParentCode(@Param("parentCode")String parentCode);

    //滞销畅销的存储过程
    List<HashMap<String, Object>> selectDrugInfoList(@Param("stoId")String stoId,@Param("spbh")String spbh,@Param("startDate")String startDate,
                                                    @Param("endDate")String endDate,@Param("type")String type);

    List<HashMap<String,Object>> selectUnitNum();


    //==============================================大屏接口======================================
    List<YxlBillsList> selectLargeScreenList();

}
